import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'


// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    port: 3001,
    hmr: true,
    proxy: {
      "/api": {
        target: 'http://localhost:8081/',
        secure: false,
        changeOrigin: true,
        pathRewrite: {
          "^api": "/api"
        }
      }
    }
  },
  resolve:{
    // 配置路劲别名
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
  },
})
